package nix.mybatis.spring;

import nix.mybatis.pojo.User;
import nix.mybatis.spring.mapper.UserMapper;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyBatisSpringMapperTest {

	@Test
	public void fun1() {
		
		ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
		// UserMapper userMapper = (UserMapper) ac.getBean("userMapper");
		UserMapper userMapper = ac.getBean(UserMapper.class);
		
		User user = userMapper.findById(10);
		System.out.println(user);
	}
}
